import { request } from "@ruifox-cms/utils";

// 分页获取留言
export function getCommentsByPageMessages(params) {
  return request({
    url: `/comment/api/commentMessages/selectPage`,
    method: "get",
    params,  
  });
}

//获取待回复和审核退回数量
export function selectAwaitAndRefuseCommentMessages(params) {
  return request({
    url: `/comment/api/commentMessages/selectAwaitAndRefuse`,
    method: "get",
    params,
  });
}

// 后台用户留言
export function insertByBackGroundCommentMessages(data) {
  return request({
    url: "/comment/api/commentMessages/insertByBackGround",
    method: "post",
    data,
  });
}

//前台用户留言
export function insertByFrontCommentMessages(data) {
  return request({
    url: "/comment/api/commentMessages/insertByFront",
    method: "post",
    data,
  });
}
// 删除留言
export function deleteCommentMessages(data) {
  return request({
    url: "/comment/api/commentMessages/delete",
    method: "post",
    data,
  });
}

// 批量删除
export function batchDeleteCommentMessages(data) {
  return request({
    url: "/comment/api/commentMessages/batchDelete",
    method: "post",
    data,
  });
}

// 修改留言
export function updateComment(data) {
  return request({
    url: "/station/api/comment/update",
    method: "post",
    data,
  });
}

// 公开留言
export function isOpeCommentMessages(data) {
  return request({
    url: "/comment/api/commentMessages/open",
    method: "post",
    data,
  });
}

// 批量共开留言
export function batchIsOpenedCommentMessages(data) {
  return request({
    url: "/comment/api/commentMessages/batchIsOpened",
    method: "post",
    data,
  });
}

// 获取留言详情
export function getCommentByIdCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/selectById",
    method: "get",
    params,
  });
}
// 标记已读
export function readCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/read",
    method: "post",
    params,
  });
}
// 后台用户获取回复树
export function getCommentTreeByIdCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/selectReplyTree",
    method: "get",
    params,
  });
}
// 前台用户获取回复树
export function selectReplyTreeByFront(params) {
  return request({
    url: "/comment/api/commentMessages/selectReplyTreeByFront",
    method: "get",
    params,
  });
}
//标记用户
export function markedManagerMarkedUser(data) {
  return request({
    url: "/comment/api/managerMarkedUser/marked",
    method: "post",
    data,
  });
}

//获取回收站留言
export function getRecycleComments(params) {
  return request({
    url: "/comment/api/commentMessages/getRecycle",
    method: "get",
    params,
  });
}

//恢复回收站留言
export function recycleCommentById(data) {
  return request({
    url: "/comment/api/commentMessages/recycleById",
    method: "post",
    data,
  });
}
//批量恢复
export function batchRecoveryCommentMessages(data) {
  return request({
    url: "/comment/api/commentMessages/batchRecovery",
    method: "post",
    data,
  });
}
//推荐留言
export function setTopCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/recommend",
    method: "post",
    params,
  });
}
//批量推荐留言
export function batchRecommendCommentMessages(data) {
  return request({
    url: "/comment/api/commentMessages/batchRecommend",
    method: "post",
    data,
  });
}
//获取热门留言
export function getHotComments(params) {
  return request({
    url: "/comment/api/commentMessages/getHotPage",
    method: "get",
    params,
  });
}

//判断该用户是否可以回复
export function canReplyCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/canReply",
    method: "post",
    params,
    header: {
      "content-type": "application/x-www-form-urlencoded",
    },
  });
}
//前台用户
// 获取留言
export function selectPageToUserCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/selectPageToUser",
    method: "get",
    params,
  });
}
// 根据id查询自己留言
export function selectByUserPageCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/selectByUserPage",
    method: "get",
    params,
  });
}
//获取所有表单分类
export function selectListCommentForm() {
  return request({
    url: "/comment/api/commentForm/selectList",
    method: "get",
  });
}
//移动留言
export function moveCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/move",
    method: "post",
    params,
  });
}
//推送留言
export function copyCommentMessages(params) {
  return request({
    url: "/comment/api/commentMessages/copy",
    method: "post",
    params,
  });
}
